//
//  HomeButton.m
//  Weibo
//
//  Created by wpapple on 16/5/31.
//  Copyright © 2016年 wpapple. All rights reserved.
//

#import "HomeButton.h"

@implementation HomeButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setAddButton];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        [self setAddButton];
    }
    return self;
}

-(void)setAddButton
{
    [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    self.imageView.contentMode = UIViewContentModeCenter;
    
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
   
}

-(void)layoutSubviews
{
    [super layoutSubviews];

//    self.titleLabel.x = self.imageView.x;
    
    self.imageView.x = CGRectGetMaxX(self.titleLabel.frame) + 5;
}

@end
